package com.show.dao.event;

import com.show.dto.Event;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

/**
 *
 * @Auther : 王硕
 * @Param : 
 * @date : 2018-01-29 上午 9:01
 */
public interface EventRepositoty extends JpaRepository<Event,String>,JpaSpecificationExecutor<Event>, CrudRepository<Event, String> {

    @Query(value = "SELECT COUNT(*) as num FROM `event` ",nativeQuery = true)
    Integer getEventNum();

    @Query(value = "SELECT * FROM `event`",nativeQuery = true)
    List<Event> getEventList();

}
